// *********************************************************
//      Copyright (c) Kosta Gaitanis
//      All rights reserved
//
//      k.gaitanis@gmail.com
//
// *********************************************************

#ifndef LIGHTSLISTWIDGET_H
#define LIGHTSLISTWIDGET_H

#include "World.h"
#include "GUI/ColorPickerWidget.h"
#include "GUI/CollapsibleWidget.h"

class LightsListWidget : public CollapsibleWidget
{
    Q_OBJECT
public:
    explicit LightsListWidget(QWidget *parent = 0);

    void addLight(Light* light);

    Light* getCurrentLight() const;

    void setAmbient(const QColor& color);
    void setDiffuse(const QColor& color);
    void setSpecular(const QColor& color);
    void setOn(bool on);

    QColor getAmbient() const;
    QColor getDiffuse() const;
    QColor getSpecular() const;

private slots:
    void onCurrentLightChanged(int index);
    void onAmbientChanged(const QColor& color);
    void onDiffuseChanged(const QColor& color);
    void onSpecularChanged(const QColor& color);
    void onOnOffChanged(bool on);

signals:
    void lightModified();


private:
    Q_DISABLE_COPY(LightsListWidget)

    QComboBox *m_combo;
    ColorPickerWidget *m_ambient, *m_diffuse, *m_specular;
    QCheckBox *m_checkBox;

};

#endif // LIGHTSLISTWIDGET_H
